<template>
  <el-page-header @back="goBack" :content="routeTitle" title="主页">
  </el-page-header>
</template>

<script>
export default {
  name: "PageHeader",
  computed: {
    routeTitle() {
      return this.$route.meta.title;
    }
  },
  methods: {
    goBack() {
      this.$confirm('确定退出考试?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 点击确认
        this.$router.push({name: 'Home'});
      }).catch(() => {
        // 点击取消
      });
    }
  }
}
</script>

<style scoped>
</style>